import Vue from 'vue'

import Cookies from 'js-cookie'

import 'normalize.css/normalize.css' // a modern alternative to CSS resets

import './styles/demo-center.css'

import Element from 'element-ui'
import './styles/element-variables.scss'
import './assets/iconfont/iconfont.css'

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import './icons' // icon
import './permission' // permission control
import './utils/error-log' // error log
// import AMap from 'vue-amap'
import * as filters from './filters' // global filters
// Vue.use(AMap)
/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online! ! !
 */
/* import { mockXHR } from '../mock'
if (process.env.NODE_ENV === 'production') {
  mockXHR()
}*/

Vue.use(Element, {
  size: Cookies.get('size') || 'medium' // set element-ui default size
})

// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

Vue.prototype.$t = function(key) {
  return key
}
// 一般项目中，对于 vue-amap 的初始化只需要调用 initAMapApiLoader 方法即可。
/* AMap.initAMapApiLoader({
  key: '2b79009c720e462a965f8e6fe46ec06a',
  plugin: ['Autocomplete', 'PlaceSearch', 'Scale', 'OverView', 'ToolBar', 'MapType', 'PolyEditor', 'AMap.CircleEditor', 'service', 'MarkerClusterer'],
  uiVersion: '1.0', // ui库版本，不配置不加载,
  v: '1.4.4',
  viewMode:'3D', // 地图模式
})*/

// VueAMap.initAMapApiLoader({
//   key: '2b79009c720e462a965f8e6fe46ec06a',
//   plugin: ['Autocomplete', 'PlaceSearch', 'Scale', 'OverView', 'ToolBar', 'MapType', 'PolyEditor', 'AMap.CircleEditor'],
//   v: '1.4.4'
// })
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
